/* enum */
import { CallCenterTypeEnum } from "@model/enum/CallCenterEnum";
/* util */
import { getRootWindow } from '@src/util/dom';

const rootWindow = getRootWindow(window);

/** 
 * @description 是否为智齿呼叫中心
 * @param {CallCenterTypeEnum} type 呼叫中心类型
*/
export function isCallCenterZhiChiType(type: CallCenterTypeEnum | number): boolean {
  return type === CallCenterTypeEnum.ZhiChi
}

/** 
 * @description 设置是否为智齿呼叫中心
 * @param {boolean} value 是否为智齿呼叫中心的值
*/
export function setIsCallCenterZhiChi(value: boolean): void {
  rootWindow.isCallCenterZhiChi = value
}

/** 
 * @description 获取是否为智齿呼叫中心
 * @returns {boolean} 是否为智齿呼叫中心
*/
export function getIsCallCenterZhiChi() {
  return rootWindow.isCallCenterZhiChi === true
}

/** 
 * @description 设置是否为天润呼叫中心
 * @param {boolean} value 是否为天润呼叫中心的值
*/
export function setIsCallCenterTianRun(value: boolean): void {
  rootWindow.isCallCenterTianRun = value
}

/** 
 * @description 获取是否为天润呼叫中心
 * @returns {boolean} 是否为天润呼叫中心
*/
export function getIsCallCenterTianRun() {
  return rootWindow.isCallCenterTianRun === true
}

/** 
 * @description 设置是否为中通天鸿呼叫中心
 * @param {boolean} value 是否为中通天鸿呼叫中心的值
*/
export function setIsCallCenterZhongTong(value: boolean): void {
  rootWindow.isCallCenterZhongTong = value
}

/** 
 * @description 获取是否为中通天鸿呼叫中心
 * @returns {boolean} 是否为中通天鸿呼叫中心
*/
export function getIsCallCenterZhongTong() {
  return rootWindow.isCallCenterZhongTong === true
}

export default {
  isCallCenterZhiChiType,
  getIsCallCenterZhiChi,
  setIsCallCenterZhiChi,
  setIsCallCenterTianRun,
  getIsCallCenterTianRun,
  setIsCallCenterZhongTong,
  getIsCallCenterZhongTong
}